Activity sensing for stimulator control

ABSTRACT

The disclosure describes a system that measures the distance between one or more electrodes and tissue of a patient, and controls one or more parameters of the stimulation delivered to the tissue by the electrodes based on the measured distance. The system controls the measurement of the distance between the electrodes and the tissue as a function of activity of the patient. The system uses, for example, a piezoelectric transducer to sense activity of the patient, and may determine whether or how frequently to measure the distance between electrodes and tissue based on the sensed physical activity. A piezoelectric transducer may be used both to sense activity and to measure the distance between the electrodes and the tissue.

RELATED APPLICATION

This application is a continuation of U.S. application Ser. No.11/116,969, filed Apr. 28, 2005 and entitled “ACTIVITY SENSING FORSTIMULATOR CONTROL,” the entire content of which is incorporated hereinby reference.

TECHNICAL FIELD

The invention relates to medical devices and, more particularly, tomedical devices that deliver stimulation.

BACKGROUND

Chronic pain, such as pain in the back, legs or pelvis, is a commonsymptom that many people endure on a daily basis, and it cansignificantly lower their quality of life. Chronic pain can beattributed to a variety of ailments that are difficult to treatdirectly. Some ailments that cause chronic pain include failed backsurgery syndrome, reflex sympathetic dystrophy, multiple sclerosis andperipheral arterial disease, and chronic pain may also be caused by poorposture, obesity, trauma or old age. Since medical intervention tocorrect the cause of chronic pain may not be possible or effective,treatment is often aimed towards suppressing the symptoms, or pain, toincrease the quality of life of a patient.

Many different types of treatment may be used to treat chronic pain.Some of these treatments include medication, acupuncture, trigger pointinjections, physical therapy, exercise, nutritional modifications, andmedical devices. Not all treatments are effective for all patients, anda combination of treatments may be prescribed by a physician.

In some cases, chronic pain may be treated with neurostimulation. Animplantable medical device may be implanted into the patient at alocation near the back or abdomen and used to generate electricalpulses. These pulses may be delivered to the spinal cord through aninsulated lead. One or more electrodes at the distal end of the leadconduct the pulses into the surrounding tissue. The lead, or a pluralityof leads, may be placed near a certain location on the spine or otherarea to suppress the pain. Stimulation may help to reduce or relieve thepain by modulating nerve impulses to the brain that signal pain.

SUMMARY

The invention is directed to a system that controls measurement of thedistance between one or more electrodes and tissue of the patient towhich the electrodes deliver stimulation based on the sensed physicalactivity. The system may determine whether or how frequently to measurethe distance based on the sensed activity. In embodiments in which animplantable medical device (IMD) measures the distance betweenelectrodes and tissue, using an activity measurement to determine whensuch measurements should occur may preserve battery life of the IMD.

The system includes sensors to sense patient activity and measure thedistance between the electrodes and the tissue. For example, the systemmay include a piezoelectric transducer or accelerometer to sensephysical activity, e.g., gross motor movement and/or footfalls, of apatient. The system may also include a piezoelectric transducer toultrasonically measure the distance between the electrodes and thetissue. In some embodiments, the sensors may be located proximate to theelectrodes to detect motion and measure the distance at the site ofstimulation, e.g., the sensors may be carried by a lead that includesthe electrodes. In some embodiments a piezoelectric transducer bothsenses activity and measures the distance.

In some stimulation systems, the electrodes that deliver stimulation arenot attached to the tissue to which they deliver the stimulation. Forexample, it is generally undesirable to physically attach electrodes tothe spinal cord for delivery of spinal cord stimulation (SCS) therapy.In such systems, patient activity and movement may change the distancebetween the tissue and the electrodes, e.g., the spinal cord and theelectrodes at the distal end of a lead. As the distance changes, theintensity of the stimulation as perceived by the patient may change,which may lead to changes in the efficacy of the stimulation or sideeffects associated with the stimulation. Consequently, a systemaccording to the invention adjusts stimulation parameter values based ona measured distance between the electrodes and the tissue to compensatefor changed distance.

Detecting distance frequently and at a constant rate, e.g., measurementsapproximately once a minute, may significantly decrease the life of abattery in an IMD, and would result in the distance being measured attimes when it is less likely to be changing, i.e., when the patient isrecumbent or asleep. Therefore, a system according to the presentinvention controls distance measurement based on sensed patientactivity, e.g., determines whether or how frequently to measure thedistance based on the sensed activity. In this way, the system may limitdistance measurements when patient activity is nominal, therebyprolonging battery life, while allowing for an increased frequency ofmeasurements during increased physical activity to provide more frequenttherapy adjustment to compensate for distance changes.

In one embodiment, the invention is directed to a method comprisingsensing activity of a patient, measuring a distance between an electrodeand tissue to which the electrode delivers stimulation based on thesensed activity, and adjusting a parameter of the stimulation as afunction of the measured distance.

In another embodiment, the invention is directed to a system comprisinga first sensor to sense activity of a patient, a second sensor tomeasure a distance between an electrode and tissue to which theelectrode delivers stimulation, and a processor to control the secondsensor to measure the distance based on the sensed activity, and adjusta parameter of the stimulation as a function of the measured distance.

In an additional embodiment, the invention provides a system comprisingmeans for sensing activity of a patient, means for measuring a distancebetween an electrode and tissue to which the electrode deliversstimulation based on the sensed activity, and means for adjusting aparameter of the stimulation as a function of the measured distance.

Although the invention may be especially applicable to spinal cordstimulation systems, the invention alternatively may be applied to othersites of stimulation where the electrodes cannot be physically attachedto the tissue of interest. These therapies may include deep brainstimulation, cortical brain stimulation, sacral or pedundal nervestimulation, or other nervous, cardiac, gastric, muscular, or othertissue stimulation that may relieve conditions other than pain.

In various embodiments, the invention may provide one or moreadvantages. For example, monitoring patient activity may allow distancedetection to occur as needed. During periods in which the patient isrecumbent or otherwise stationary, distance detection may not be needed,and battery consumption due to frequent distance measurement can beavoided. The system may detect periods of increasing patient activity.During these periods, the system may measure the distance morefrequently. While this may consume more power, the increased measurementfrequency may improve the uniformity of the stimulation received at thetissue during such high activity periods by enabling more frequentadjustment of the stimulation parameters.

In some cases, the system may not measure the distance until theactivity surpasses a certain threshold. Further, some embodiments mayutilize a distance measurement frequency that is a function of theactivity level. This relationship may be, for example, linear, step-wiseor logarithmic. In addition, the patient or clinician may modify storedmeasurement/activity or distance/stimulation parameter functions with anexternal programmer that communicates with the implantable stimulatorwirelessly.

The details of one or more embodiments of the invention are set forth inthe accompanying drawings and the description below. Other features,objects, and advantages of the invention will be apparent from thedescription and drawings, and from the claims.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a conceptual diagram illustrating an example stimulationsystem in conjunction with a patient.

FIG. 2 is a schematic diagram illustrating a distal portion of animplantable lead with several electrodes and piezoelectric transducers.

FIG. 3 is a cross-sectional side view of the distal portion of theimplantable lead in relation to tissue.

FIG. 4 is functional block diagram illustrating components of anexemplary implantable medical device.

FIG. 5 is a flow diagram illustrating an example technique for detectingthe distance between electrodes and tissue based on sensed patientactivity during stimulation.

FIG. 6 is a flow diagram illustrating another example technique fordetecting the distance between electrodes and tissue based on sensedpatient activity during stimulation.

FIGS. 7A-7D are graphs showing exemplary functional relationshipsbetween patient activity and frequency of electrode/tissue distancemeasurements.

DETAILED DESCRIPTION

FIG. 1 is a conceptual diagram illustrating an example system 10 inconjunction with a patient 12. As shown in FIG. 1, system 10 may includean implantable medical device (IMD) 18 that delivers stimulation topatient 12, and an external programmer 16. IMD 18 is coupled to a lead20 and delivers stimulation to patient 12 via the lead. Moreparticularly, IMD 18 delivers stimulation via one or more electrodes(not shown in FIG. 1) carried by lead, e.g., located on a distal portionof lead. Although illustrated as coupled to a single lead 20, IMD 18 maybe coupled to any number of leads 20.

In the illustrated example, IMD 18 is an implantable neurostimulatorthat delivers stimulation to the spinal cord 14 of patient 12 via lead20, i.e., provides spinal cord stimulation (SCS) therapy. However, theinvention is not limited to IMDs that deliver SCS therapy, IMDs thatdeliver neurostimulation therapy, or even to IMDs. The invention may beembodied in systems that include any type of implantable or externalmedical device that delivers stimulation to tissue of a patient. The oneor more electrodes for delivery of stimulation may be, for example,carried by leads, integrated into a housing of a medical device, and/orapplied to an external surface, e.g., the skin, of a patient.

As will be described in greater detail below, system 10 measures thedistance between the one or more electrodes and the tissue to which theelectrodes deliver stimulation from IMD 18, and the adjusts one or moreparameters of the stimulation based on the measured distance. In someembodiments, IMD 18 delivers stimulation in the form of electricalpulses. In such embodiments, the stimulation parameters that may beadjusted include voltage or current pulse amplitude, width and rate. Ingeneral, the stimulation is adjusted to maintain a substantiallyconsistent level of stimulation current at the tissue despite changes inthe distance between the electrodes and the tissue.

System 10 also senses the activity of patient 12, and measures theelectrode/tissue distance based on the sensed activity is sensed. Ingeneral, the electrode/tissue distance is more likely to vary when thepatient is active. Consequently, system 10 may determine whether and/orhow often to measures the distance based on the sensed activity in orderto provide more frequent measurements and parameter adjustments whennecessary, while conserving a power source when frequent measurementsand parameter adjustments are not necessary.

In the illustrated example, system 10 includes a external programmer 16that communicates with IMD 18 via wireless telemetry. A clinician orpatient 12 may use programmer 16 to adjust stimulation parameters, or tointerrogate IMD 18 for information stored therein, as is known in theart. External programmer 16 may be, for example, a desktop, laptop,tablet, handheld, or other computing device.

In some embodiments, external programmer 16 may be a small,battery-powered, portable device that accompanies the patient 12throughout a daily routine. In such embodiments, programmer 16 may havea simple user interface, such as a button or keypad, and a display orlights. Patient 12 may initiate, modify or cease stimulation via theuser interface.

Although described herein primarily in the context of embodiments inwhich IMD 18 senses patient activity, measures electrode/tissue distancewhen activity is sensed, and adjusts one or more parameter values basedon the measured distance, the invention is not so limited. For example,in some embodiments, an external computing device, such programmer 16,may perform one or more of these functions. For example, programmer 16may receive signals indicating patient activity and electrode/tissuedistance from IMD via telemetry, and may control the frequency ofelectrode/tissue distance measurement and adjust stimulation parametersbased on the received signals.

FIG. 2 is a schematic diagram illustrating a distal portion 22 of lead20 according to one example embodiment of the invention. In theillustrated example, distal portion 22 includes a plurality ofelectrodes 24A, 24B, 24C and 24D (collectively, “electrodes 24”) and aplurality of piezoelectric transducers 26A, 26B and 26C (collectively,“piezoelectric transducers 26”). Although distal portion 22 is shown ashaving a “paddle” shape known in the art, the invention is not limitedto any particular type of lead. Lead 20 may be any type ofpercutaneously or surgically implantable lead. Further, the numbers,shapes and locations of electrodes 24 and transducers 26 are merelyexemplary

In this exemplary embodiment, piezoelectric transducers 26 may be usedfor two different purposes. Transducers may be used to measure thedistance between themselves and the tissue to be stimulated, i.e. spinalcord 14. Each piezoelectric transducer 26 may be composed of two layersthat respectively act as an ultrasonic transmitter and an ultrasonicreceiver. One layer produces an ultrasonic wave that travels to thetissue where it is partially reflected. The reflected echo wave isreceived by the other layer of the transducer, at which time thedistance can be calculated based on the time between the sent andreceived waves. This measured distance allows adjustment of pulseparameters in order to provide substantially consistent stimulationintensity regardless of changes in the distance between the distalportion 22, e.g., electrodes 24, and the tissue.

Piezoelectric transducers 26 may also be used to sense physical activityof patient 12. Piezoelectric transducers 26 may transducer vibrationsassociated with gross motor movement and/or footfalls of patient 12.System 10 may use the magnitude and/or frequency of the vibrationsdetected by piezoelectric transducers to identify an activity level ofpatient 12 that may be used to determine whether and/or how frequentlyto measure the distance between electrodes 24 and the tissue.Piezoelectric transducers 26 may continuously or periodically sense theactivity level of patient 12.

In general, the size of the electrodes and piezoelectric transducerswould be limited. The diameter of each electrode 26 may be less than 7mm with a thickness of less than 3 mm. Preferably, the diameter of eachelectrode would be less than 5 mm with a thickness less than 2 mm. Thesize of each transducer 26 may be less than 7 mm by 7 mm with athickness less than 3 mm. Preferably, the transducer would be less than5 mm by 5 mm with a thickness less than 2 mm. The sizes of eachelectrode and transducer may not need to be identical as electrodes andtransducers of varying sizes may be used on the same distal portion.

In some embodiments, a plurality of piezoelectric transducers 26 sensepatient activity, while, in other embodiments, only one of transducers26 detects activity. Multiple transducers 26 may be placed on differentaxes in order to more accurately detect motion in a plurality ofdirections. In some embodiments, transducers 26 are dedicated to eitherdistance measurement or activity sensing, while some embodiments mayonly include one piezoelectric transducer 26 that both measures distanceand senses activity in order to reduce the size of distal end 22.

The invention is not limited to embodiments in which either or both ofthe activity sensors and distance measurement sensors of system 10 arepiezoelectric transducers. In some embodiments, for example, an activitysensor may be an accelerometer, mercury switch, EMG electrode, ECGelectrode, or the like, which generate signals that vary as a functionof patient activity. Further, the distance measurement sensors may beany type of ultrasonic or non-ultrasonic distance measurement sensor.For example, in some embodiments, distance may be measured optically.

Further, the invention is not limited to embodiments in which suchsensors are carried on the same lead as each other or electrodes 24. Ingeneral, it is desirable to place distance measurement sensors proximateto electrodes. However, activity sensors may located anywhere within oroutside of patient 12.

FIG. 3 is a cross-sectional side view of the distal portion 22 of lead20 in relation to tissue at an intended stimulation site, e.g., spinalcord 14. Electrodes 24 and piezoelectric transducers 26 are aimedthrough intervening space 30, which may be fluid, towards spinal cord14. The thickness of space 30 is distance D. The “bolts” illustrated byFIG. 3 signify stimulation from electrodes 24, and the “wavy” linesindicate ultrasonic waves emitted from the piezoelectric transducers 26.

It is desirable to assure that the stimulation from IMD 18 travelsthrough space 30 and still provides appropriate stimulation foreffective therapy. For this to occur, the magnitude of space 30, D, ismeasured periodically as the patient is active. In the illustratedembodiments, piezoelectric transducers 26 are located near theelectrodes in case distance D varies along distal portion 22. IMD 18 maybe capable of providing stimulation with a different magnitude to eachof electrode 24 based on the distance measured proximate to theparticular electrode. For example, piezoelectric transducer 26A maymeasure a larger distance D to the spinal cord than piezoelectrictransducer 26B. Therefore, stimulation with greater magnitude may bedelivered to electrodes 24A and 24B than electrodes 24C and 24D.

In this embodiment, the center piezoelectric transducer 26C is used todetect activity of patient 12, e.g., motion of distal portion 22. Beinglocated in the center of the distal portion may be beneficial foracquiring an accurate estimate of the motion experienced by the entiredistal portion. When activity is detected at the site, piezoelectrictransducers 26A and 26B may measure the distance D at their respectivelocations. Ultrasonic waves are produced in the direction of the tissuewhich subsequently reflects back as echo waves. The receiving layer ofthe same transducer detects the echo waves and the distance D iscalculated. This distance could be averaged between the two transducersif the distal portion is generally parallel to spinal cord 14.Adjustments to stimulation parameters, e.g., the magnitude of thestimulation delivered by the electrodes 24, are then calculated basedupon distance D. In some cases, transducer 26A may be used to measurethe distance D for electrodes 26A and 26B while transducer 26B may beused to measure the distance D for electrodes 24C and 24D, as discussedabove.

FIG. 4 is a functional block diagram illustrating various components ofIMD 18. In the example of FIG. 4, IMD 18 includes a processor 36, memory38, stimulation pulse generator 40, distance measurement element 42,activity sensing element 44, telemetry interface 48, and power source50. As shown in FIG. 4, stimulation generator 40 is coupled toelectrodes 24, while distance measurement element 42 and activitysensing element 44 are coupled to piezoelectric transducers 26.Alternatively, distance measurement element 42 and activity sensingelement 44 may be coupled to any of a variety separate or commondistance and activity sensors, as described above.

Processor 36 controls stimulation pulse generator 40 to deliverelectrical stimulation therapy according to stimulation parameter valuesstored in memory 38. Processor 36 may receive such parameter values fromprogrammer 16 via telemetry interface 48. Based on activity informationreceived from the activity sensing element 44, processor determines ifand how often distance detection should occur. When appropriate,processor 36 controls distance measurement element 42 to acquire adistance measurement. Processor 36 then determines whether any therapyparameter adjustments should be made based on the measured distance. Forexample, processor 36 may compare the new distance measurement to thecurrent distance measurement, and make changes to stimulation parametersif they are different. Processor 36 may store the adjustments in memory38 and provide the adjustments to stimulation generator 20.

As an example, in the presence of patient activity, processor 36 maycontrol distance measurement element 42 to perform a distancemeasurement. In the case of a distance measurement smaller than thecurrent value, processor 36 may decrease a stimulation parameter, suchas pulse amplitude. If the distance measurement is greater than thecurrent value, processor 36 may increase the stimulation parameter.These adjustments would be carried out in order to provide asubstantially consistent stimulation intensity at spinal cord 14regardless of the distance between the electrodes and the spinal cord.Although processor 36 is described in this example as adjustingstimulation parameters, it is noted that the adjustments may begenerated by external programmer 16, and more particularly a processorwithin external programmer 16, as discussed above.

Activity sensing element 44 may comprise amplifiers, filters and othersignal processing circuitry to process the signals received from one ormore piezoelectric transducers 26. Based on the amplitude and/orfrequency of the processed signal, processor 36 may identify an activitylevel that may be used to determine whether or how often to measuredistance.

Distance measurement element 42 may include circuits to drivepiezoelectric transducers 26 to output ultrasonic waves in response to asignal from processor 36, and signal processing circuitry to detect andprocess the returned echo signal. Processor 36 may calculate theelectrode/tissue distance based on a signal received from the distancemeasurement element 42 indicating detection of the echo.

Processor 36 may comprise any one or more of a microprocessor, digitalsignal processor (DSP), application specific integrated circuit (ASIC),field-programmable gate array (FPGA), or other digital logic circuitry.Memory 38 stores instructions for execution by processor 36, stimulationtherapy data, e.g., values for stimulation therapy parameters, activitydata and distance data. The activity and distance data are received fromdistance measurement and activity sensing elements 42 and 44, and may berecorded for long-term storage and retrieval by a user via programmer 16(FIG. 1) and telemetry interface 48. Memory 38 may include any one ormore of a random access memory (RAM), read-only memory (ROM),electronically-erasable programmable ROM (EEPROM), flash memory, or thelike.

Wireless telemetry in IMD 18 may be accomplished by radio frequency (RF)communication or proximal inductive interaction of IMD 18 with externalprogrammer 16. This wireless communication is possible through the useof telemetry interface 48. Accordingly, telemetry interface 48 may besimilar to the telemetry interface contained within external programmer16.

Power source 50 delivers operating power to the components ofimplantable IMD 18. Power source 50 may include a battery and a powergeneration circuit to produce the operating power. In some embodiments,the battery may be rechargeable to allow extended operation. Rechargingmay be accomplished through proximal inductive interaction between anexternal charger and an inductive charging coil within IMD 18. In otherembodiments, traditional batteries may be used. As a furtheralternative, an external inductive power supply could transcutaneouslypower IMD 18 whenever stimulation is needed or desired.

Measuring the distance between the electrodes and the tissue of interestconsumes a small amount of current, but constant detection couldsignificantly shorten the life of an implanted battery designed to lastmany years. If distance detection occurs at approximately once perminute, the overall lifetime of such a battery may be reduced byapproximately 20 percent. Sensing activity may help to limit thisdecrease in battery life by reducing or eliminating unnecessary distancemeasuring while the patient is stationary. For example, it would beunnecessary for the distance detection to occur during sleep. This timemay take up anywhere from 20 to 40 percent of a patient's day.Alternatively, sensing activity may allow for more distance measurementsduring periods of a patient's day when the distance may be changing moreoften. The result is a stimulator system that provides distancemeasurement when required without sacrificing large losses in batterylife.

FIG. 5 is a flow diagram illustrating an example technique for detectingthe distance between electrodes and tissue based on sensed patientactivity during stimulation that may be performed by system 10. In theexample of FIG. 5, system 10 measures the distance between theelectrodes and tissue to which the electrodes deliver stimulation (52).System 10 uses the distance measurement to determine an adjustment toone or more stimulation parameters, such as pulse amplitude (54). System10 delivers stimulation at the adjusted parameter values, e.g., with theadjusted amplitude, via the electrodes (56). After stimulation has beendelivered, system 10 senses patient activity, and determines whethersuch activity exceeds a threshold value (58). If no activity is presentabove a specified threshold, then stimulation continues with currentparameters. If activity has been detected above a predeterminedthreshold, the loop begins again and resets stimulation parameters bymeasuring the distance and adjusting the parameters based on themeasured distance.

FIG. 6 is a flow diagram illustrating another example technique fordetecting the distance between electrodes and tissue based on sensedpatient activity during stimulation that may be performed by system 10.In the example of FIG. 6, system 10 determines a patient activity levelbased on the output of a sensor, such as piezoelectric transducer 26,and adjusts a distance measurement frequency based on the sensedactivity level (60, 62). System 10 determines whether it is time for aelectrode/tissue distance measurement based on the current frequency(64). If it is not time for a measurement, system 10 continues tomonitor the activity level and adjust the measurement frequency. When itis time for a distance measurement, system 10 measures theelectrode/tissue distance, and adjusts a stimulation parameter, such aspulse amplitude, based on the measured distance (66, 68)

FIGS. 7A-7D are graphs 70, 72, 74 and 76 showing exemplary functionalrelationships between the sensed activity and the electrode/tissuemeasurement frequency. Graph 70 illustrates a linear relationshipbetween activity and the measurement frequency. As the patient movesmore frequently, for example, the distance detection may occur morefrequently as well in order to provide substantially consistentstimulation at the intended tissue. The slope of the linear function mayvary, and a clinician may set the slope to a variety of values.

Graph 72 displays a linear relationship similar to graph 70, however athreshold is also applied. In this embodiment of the function, themeasurement frequency always occurs at a nominal frequency when anyactivity is present. When the activity increases beyond a predeterminedthreshold, a linear relationship between the sensed activity andmeasurement frequency is established. The threshold may be set to avariety of values to best treat the patient. In some embodiments, thisthreshold may indicate that no distance detection should occur undernominal activity until more frequent or strenuous activity is sensed.

The function displayed in graph 74 is a step-wise function to controlthe detection frequency. In general, there would be three separatelevels of distance measurement frequency based upon the activity of thepatient. As the activity increases, the frequency of distancemeasurement increases as well. Some embodiments may include a differentnumber of levels, while the levels in other embodiments may not beuniform in step increases.

In a further embodiment, the functional relationship in graph 76 shows alogarithmic function. When the activity level is low, it may bebeneficial to have a larger change in measurement frequency with only asmall change in activity level. However, with increasing activity, themeasurement frequency necessary for adequate therapy may reach a limit.In this case, very high activity would not require large changes indistance measurement frequency that may only cause increasing drain uponbattery resources while not contributing to more effective stimulation.

It should be noted at that all of the functional relationships describedin FIG. 7 are only examples, and system 10 may be capable of programmingany type of function desired by the clinician. In particular, any of thefunctions herein may be combined to provide customized activity-basedstimulation adjustments for a specific patient. These custom functionsmay include a variety of thresholds, magnitudes, and curves described bya mathematical equation or sets of mathematical equations.

Although the invention may be especially applicable to the simulation ofthe spinal cord, the invention alternatively may be applied moregenerally to any type of stimulation wherein the electrode may move withrespect to the targeted tissue. As examples, cortical brain stimulation,deep brain stimulation, sacral or pedundal nerve stimulation, or dorsalroot stimulation may benefit from activity regulated distancemeasurement as described herein. In addition, even electrodes fixed tonervous or muscle tissue may utilize this invention to periodicallymeasure a change in distance with high activity levels or long timeperiods.

Various embodiments of the described invention may include processorsthat are realized by microprocessors, Application-Specific IntegratedCircuits (ASIC), Field-Programmable Gate Arrays (FPGA), or otherequivalent integrated logic circuitry. The processor may also utilizeseveral different types of storage methods to hold computer-readableinstructions for the device operation and data storage. These memory andstorage media types may include a type of hard disk, random accessmemory (RAM), or flash memory, e.g. CompactFlash or SmartMedia. Eachstorage option may be chosen depending on the embodiment of theinvention. While the implantable IMD 18 may contain permanent memory,external programmer 16 may contain a more portable removable memory typeto enable easy data transfer for offline data analysis.

The preceding specific embodiments are illustrative of the practice ofthe invention. It is to be understood, therefore, that other expedientsknown to those skilled in the art or disclosed herein may be employedwithout departing from the invention or the scope of the claims.

Many embodiments of the invention have been described. Variousmodifications may be made without departing from the scope of theclaims. These and other embodiments are within the scope of thefollowing claims.

1. A system comprising: a first sensor to sense activity of a patient; asecond sensor to measure a distance between an electrode and a tissue towhich the electrode delivers stimulation; and a processor to control thesecond sensor to measure the distance based on the sensed activity, andadjust a parameter of the stimulation based on a change in the measureddistance between the electrode and the tissue.
 2. The system of claim 1,wherein the processor adjusts at least one of a pulse amplitude, a pulsewidth, or a pulse rate of the stimulation based on the change in themeasured distance between the electrode and the tissue.
 3. The system ofclaim 1, further comprising a lead that carries the electrode and thefirst and second sensors.
 4. The system of claim 1, wherein the firstsensor comprises a piezoelectric transducer.
 5. The system of claim 1,wherein the second sensor ultrasonically measures the distance.
 6. Thesystem of claim 5, wherein the second sensor comprises a piezoelectrictransducer.
 7. The system of claim 1, wherein the first and secondsensors comprise a common piezoelectric transducer.
 8. The system ofclaim 1, wherein the processor compares the sensed activity to athreshold value, and controls measurement of the distance when thesensed activity exceeds the threshold value.
 9. The system of claim 1,wherein the processor compares the sensed activity to a plurality ofthresholds, each of the thresholds associated with a respective one of aplurality of distance measurement frequencies, and controls measurementof the distance at one of the plurality of frequencies based on thecomparison.
 10. The system of claim 1, wherein the processor controlsmeasurement of the distance at a frequency determined as a function ofthe sensed activity.
 11. The system of claim 1, further comprising animplantable medical device that delivers the stimulation via theelectrode, wherein the processor is a processor of the implantablemedical device.